/*

Author   : chaos

FileName : inh_friend.cpp

Date     : 14/08/17 11:29:42

*/
#include <iostream>
using namespace std;

class Base
{
    protected:
        int a;
        friend class Friend;

    public:
        Base(int i):a(i){}
};

class Derived:public Base
{
    private:
        int b;
    public:
        Derived(int i):Base(i),b(1){}
};

class Friend
{
    public:
        void get_data()
        {
            Derived derived(2);
            cout <<"access Derived's a :" << derived.a << endl;

            //cout << "access Derived's b :" << derived.b << endl;
        }
};

int main(int argc ,char *argv[])
{
    Friend A_Friend;

    A_Friend.get_data();
    return 0;
}
